Ubuntu 11.04
Sponsored Link

NFS Server
2011/04/30
  Configure NFS Server to share any directories in local network.

[1] Configuration on the system you want to build NFS server
root@master:~#
aptitude -y install nfs-kernel-server portmap


root@master:~#
vi /etc/exports


# write like below *note

/home 10.0.0.0/24(rw,sync,fsid=0,no_root_squash,no_subtree_check)


# *note
/home
⇒ shared directory

10.0.0.0/24
⇒ range of networks NFS permits accesses

rw
⇒ possible to read and write

sync
⇒ synchronize

no_root_squash
⇒ enable root privilege

no_subtree_check
⇒ disable subtree check


root@master:~#
service portmap restart

portmap start/running, process 1097
root@master:~#
/etc/init.d/nfs-kernel-server restart

* Stopping NFS kernel daemon
  ...done.
* Unexporting directories for NFS kernel daemon...
  ...done.
* Exporting directories for NFS kernel daemon...
  ...done.
* Starting NFS kernel daemon
  ...done.
[2] Configuration on NFS clients
root@www:~#
aptitude -y install nfs-common portmap


root@www:~#
mount -t nfs master.srv.world:/home /home

root@www:~#
df -h

Filesystem
Size
Used
Avail
Use%
Mounted on

/dev/mapper/www-root
19G
611M
18G
4%
/

none
997M
160K
997M
0%
/dev

none
1005M
0K
1005M
1%
/dev/shm

none
1005M
60K
1005M
0%
/var/run

none
1005M
0
1005M
0%
/var/lock

/dev/vda1
236M
22M
202M
10%
/boot

master.srv.world:/home
19G
611M
18G
4%
/home

# home directory on NFS is mounted


root@www:~#
vi /etc/fstab


# add at the last: change home directory this server mounts to the one on NFS

master.srv.world:/home   /home   nfs   defaults   0 1
 
Tweet